package org.toonWatch

class TransactionController {
    
    def springSecurityService
    def shoppingCartService

    def scaffold = true
    
    def createTranaction = {
        //new Tranaction(value : "blah");
    }
    
    def viewCart = {
        def user = springSecurityService.currentUser
        def list = TempCart.findAllByUser_IdAndStatus(user.id, "COMPLETE")
        return[list : list]
    }
    
    def viewTransactions = {
        def cart = TempCart.findByIdAndStatus(params.id,"COMPLETE")
        def transactions = cart.transactions
        return [cart : cart, transactions : transactions]
    }
    
    
}
